﻿using JamesZhao.Engine.GameObjects;
using SlimDX.DirectInput;
using SlimMath;

namespace JamesZhao.Engine.GameComponents
{
    internal class SimpleMoveComponent : GameComponent
    {
        public SimpleMoveComponent(GameObject owner) : base(owner)
        {
        }

        public override void Update()
        {
            base.Update();
            float dx = 0;
            float dz = 0;
            if (Input.GetKey(Key.W)) dx = 1;
            if (Input.GetKey(Key.S)) dx = -1;

            if (Input.GetKey(Key.A)) dz = 1;
            if (Input.GetKey(Key.D)) dz = -1;
            Transform.LocalPosition += new Vector3(dx/3, dz/10, 0);
            //Transform.LocalRotation *= Quaternion.RotationYawPitchRoll(dz / 100, 0, dx / 100);
        }
    }
}